function depClone(obj) {
    let newObj = obj.constructor == Array ? [] : {}
    Object.values(obj).forEach(key => {
        if (Object.hasOwnProperty(key)) {
            if (typeof obj[key] == "object") {
                obj[key] = depClone(obj[key])
            } else {
                obj[key] = obj[key]
            }
        }
    })
    return newObj
}

function clone(obj) {
    let newObj = obj.constructor == Array ? [] : {}
    Object.values(obj).forEach(key => {
        if (Object.hasOwnProperty(key)) {
            obj[key] = obj[key]
        }
    })
    return obj
}